$("#basic-addon2").click(function() {
    $(".report-time").css("display", "block");
})

$(function() {
    var senseContent =
        "<div class='second-danger' id='senseDemo'>" +
        "<div><h6>事件主题：</h6><p>湖边补调管道破损</p></div>" +
        "<div><h6>事件地点：</h6><p>湖里区仙岳路辅路管理所附</p></div>" +
        "<div><h6>更新时间：</h6><p>2017-01-11 09:30</p></div>" +
        "<div><h6>更新进度：</h6><p>已经在破损井盖旁边设置警示牌，已经在破损井盖旁边设置警示牌</p></div>" +
        "</div>" +
        "</div>";
    var boxContent =
        "<div class='senseContent' id='senseDemo'>" +
        "<div><h6>类别：</h6><p>供水井盖</p></div>" +
        "<div><h6>名称：</h6><p>金山小区供水井盖</p></div>" +
        "<div><h6>编号：</h6><p>J0010</p></div>" +
        "<div><h6>年份：</h6><p>2016/2/2</p></div>" +
        "<div><h6>规格：</h6><p>700mm</p></div>" +
        "<div><h6>井深：</h6><p>700mm</p></div>" +
        "<div><h6>防护：</h6><p>防护网</p></div>" +
        "<div><h6>爬梯：</h6><p>有</p></div>" +
        "<div><h6>寿命：</h6><p>20年</p></div>" +
        "<div><h6>材质：</h6><p>铸造</p></div>" +
        "<div><h6>形状：</h6><p>圆形</p></div>" +
        "<div><h6>责任：</h6><p>林海洋</p></div>" +
        "<div><h6>部门：</h6><p>湖边所检修班</p></div>" +
        "<div><h6>备注：</h6><p>井内有积水</p></div>" +
        "</div>" +
        "</div>";

    var coverContent =
        "<div class='senseContent' id='senseDemo'>" +
        "<div><h5>宋卫国&nbsp; </h5><p>湖里水库管理所 &nbsp; &nbsp;  状态：<span>在线</span></p></div>" +
        "<div><h6>当前位置：</h6><p>湖里区仙岳路金三小学</p></div>" +
        "<div><h6>最近在线：</h6><p>2017-01-21 08:45</p></div>" +
        "<div><h6>手机号码：</h6><p>18031561545</p></div>" +
        "<div><h6>今日上报数/总上报数：</h6><p>2/226</p></div>" +
        "<div><h6>今日完成数/总上报数：</h6><p>2/226</p></div>" +

        "<div><h6>坐标：</h6><p>北纬N24.23.55.55 东经E118.56 2152</p></div>" +

        "</div>";
    var map = new BMap.Map("map"); // 百度地图API定位一个厦门大位置功能
    var point = new BMap.Point(118.10388605, 24.48923061);
    var senseWindow = new BMap.InfoWindow(senseContent); // 创建信息窗口对象
    var boxWindow = new BMap.InfoWindow(boxContent); // 创建信息窗口对象
    var coverWindow = new BMap.InfoWindow(coverContent); // 创建信息窗口对象
    map.centerAndZoom(point, 15);
    map.enableScrollWheelZoom();
    //创建传感小图标
    var pt = new BMap.Point(118.10388605, 24.5);
    var myIcon = new BMap.Icon("images/sense.png", new BMap.Size(300, 157));
    var marker = new BMap.Marker(pt, { icon: myIcon }); // 创建标注
    map.addOverlay(marker);
    marker.addEventListener("click", function() {
        this.openInfoWindow(senseWindow);
        //图片加载完毕重绘infowindow
        document.getElementById('senseDemo').onload = function() {
            senseWindow.redraw(); //防止在网速较慢，图片未加载时，生成的信息框高度比图片的总高度小，导致图片部分被隐藏
        }
    });
    //创建涵匣小图标
    var pt = new BMap.Point(118.10388605, 24.48923061);
    var myIcon = new BMap.Icon("images/box.png", new BMap.Size(300, 157));
    var marker2 = new BMap.Marker(pt, { icon: myIcon }); // 创建标注
    map.addOverlay(marker2);
    marker2.addEventListener("click", function() {
        this.openInfoWindow(boxWindow);
        //图片加载完毕重绘infowindow
        document.getElementById('boxDemo').onload = function() {
            boxWindow.redraw(); //防止在网速较慢，图片未加载时，生成的信息框高度比图片的总高度小，导致图片部分被隐藏
        }
    });
    //创建井盖小图标
    var pt = new BMap.Point(118.10388605, 24.48);
    var myIcon = new BMap.Icon("images/build.png", new BMap.Size(500, 157));
    var marker4 = new BMap.Marker(pt, { icon: myIcon }); // 创建标注
    map.addOverlay(marker4);
    marker4.addEventListener("click", function() {
        this.openInfoWindow(coverWindow);
        //图片加载完毕重绘infowindow
        document.getElementById('coverDemo').onload = function() {
            coverWindow.redraw(); //防止在网速较慢，图片未加载时，生成的信息框高度比图片的总高度小，导致图片部分被隐藏
        }
    });


})
